package com.shy.springframework.beans.factory.config;

import com.shy.springframework.beans.factory.HierarchicalBeanFactory;
import com.shy.springframework.core.convert.ConversionService;
import com.shy.springframework.util.StringValueResolver;

public interface ConfigurableBeanFactory extends HierarchicalBeanFactory, SingletonBeanRegistry{
    String SCOPE_SINGLETON = "singleton";
    String SCOPE_PROTOTYPE = "prototype";

    void addBeanPostProcessor(BeanPostProcessor beanPostProcessor);

    void destroySingletons();

    /**
     * 添加字符串解析器,用来解析内置的值例如注解属性
     * @param valueResolver
     */
    void addEmbeddedValueResolver(StringValueResolver valueResolver);

    /**
     * 解析内置的值
     * @param value
     * @return
     */
    String resolveEmbeddedValue(String value);

    /**
     * 设置类型转换服务
     * @param conversionService
     */
    void setConversionService(ConversionService conversionService);

    /**
     * 获取类型转换服务
     * @return
     */
    ConversionService getConversionService();
}
